import App from './App';

import customer from '@/components/customer/customer';
import store from './store/index';

// Api函数polyfill（目前为实验版本，如不需要，可删除！）';
// import Polyfill from './polyfill/polyfill';
// Polyfill.init();

// 全局mixins，用于实现setData等功能，请勿删除！';
import Mixin from './polyfill/mixins';

import filters from './utils/filter';

// #ifndef VUE3
import Vue from 'vue';
import uView from '@/uni_modules/uview-ui';

Vue.mixin(Mixin);
Vue.component('customer',customer)
Object.keys(filters).forEach(filterName=>{
	Vue.filter(filterName,filters[filterName]);
})

//#ifdef H5
// 本地调试时开启-上线时记住一定要关闭
var userInfo = uni.getStorageSync('userInfo');
var clientType = uni.getStorageSync('clientType');
const whiteUser = ['13035801646', '13413545197', '17379742274', '18702092475']; // 测试白名单
if (whiteUser.includes(userInfo.telephone)) {
    const vconsole = require('@/utils/vconsole.min.js')
    Vue.prototype.$vconsole = new vconsole() // 使用vconsole
}

// const vconsole = require('@/utils/vconsole.min.js')
// Vue.prototype.$vconsole = new vconsole() // 使用vconsole
//#endif

Vue.config.productionTip = false;
App.mpType = 'app';
const app = new Vue({
    ...App,
	store
});
Vue.use(uView)

// 如此配置即可
uni.$u.config.unit = 'rpx'
app.$mount();
// #endif

//引入echarts
// import * as echarts from 'components/echart/echarts.min.js'
// Vue.prototype.$echarts = {}

// #ifdef VUE3
import { createSSRApp } from 'vue';
export function createApp() {
    const app = createSSRApp(App);
    app.mixin(Mixin);
	Object.keys(filters).forEach(filterName=>{
		app.filter(filterName,filters[filterName]);
	})
    return {
        app
    };
}
// #endif
